
/**
 * 有限状态机基类
 */
export abstract class FsmBase{
    protected _name:string;

    get name():string{
        return this._name;
    }

    get fullName(): string{
        return this.ownerType + this._name;
    }

    abstract readonly ownerType:string;
    /**
     * 有限状态机更新
     * @param dt 间隔时间(秒) 
     */
    protected abstract _tick(dt:number):void;

    /**
     * 开启有限状态机
     * @param stateName 
     */
    public abstract start(stateName:string):void;
    /**
     * 关闭并清理有限状态机
     */
    public abstract shutdown():void;
    
    // abstract readonly owner: OwnerT|null;
    abstract readonly fmsStateCount: number;
    abstract readonly isRunning: boolean;
    abstract readonly isDestroyed: boolean;
    // abstract readonly currentState: FsmState<OwnerT>|null;
    abstract readonly currentStateTime: number;
    abstract readonly currentStateName: string;
    // abstract start<T extends FsmState<OwnerT>>(stateClass: new () => T): void;
    // abstract hasState<T extends FsmState<OwnerT>>(stateClass: new () => T): boolean;
    // abstract getState<T extends FsmState<OwnerT>>(stateClass: new () => T): T | undefined;
    // abstract getAllStates(): FsmState<OwnerT>[];
    // abstract changeState<T extends FsmState<OwnerT>>(stateClass: new () => T): void;
}
